package com.atguigu.gulimall.product.vo;

import com.atguigu.gulimall.product.entity.SkuImagesEntity;
import com.atguigu.gulimall.product.entity.SkuInfoEntity;
import com.atguigu.gulimall.product.entity.SpuInfoDescEntity;
import lombok.Data;
import lombok.ToString;

import java.util.List;

/**
 * @program: gulimall
 * @description:
 * @author: 江天赐
 * @create: 2022-08-10 09:14
 */
@Data
@ToString
public class SkuItemVo {

    //1.sku 基本信息 pms_sku_info
    SkuInfoEntity info;

    boolean hasStock = true;

    //2.sku的图片信息 pms_sku_imgaes
    List<SkuImagesEntity> images;
    //3.获取spu的销售组合
    List<SkuItemSaleAttrVo> saleAttr;
    //4.获取spu的介绍
    SpuInfoDescEntity desp;
    //5.获取spu的规格参数信息
    List<SpuItemAttrGroupVo> groupAttrs;
    //当前商品的秒杀优惠信息
    SeckillInfoVo seckillInfoVo;
    @Data
    @ToString
    public static class SkuItemSaleAttrVo {
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuIdVo> attrValues;
    }

    @Data
    public static class AttrValueWithSkuIdVo {
        private String attrValue;
        private String skuIds;
    }

    @ToString
    @Data
    public static class SpuItemAttrGroupVo {
        private String groupName;
        private List<SpuBaseAttrVo> attrs;
    }

    @ToString
    @Data
    public static class SpuBaseAttrVo {
        private String attrName;
        private String attrValue;
    }
}
